function checkForm(form) { 
  if (form.team.value == "Select Team") {
    alert("Wait there little buddy. You should select a team first");
    form.team.focus(); 
    return false;    
  }//end of if
  if (form.players_array.value == ""){
    alert("Wait there little buddy. You should write a text first");
    form.players_array.focus(); 
    return false;
  }//end of if
  void(0);
}//end of Checkform

function hidediv(id) {
	
	if (document.getElementById) 
	{ // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else 
	{
		if (document.layers) 
		{ // Netscape 4
			document.id.display = 'none';
		}
		else 
		{ // IE 4
			document.all.id.style.display = 'none';
		}
	}
}//end of hidediv

function showdiv(id)  {
	if (document.getElementById) 
	{ // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else 
	{
		if (document.layers) 
		{ // Netscape 4
			document.id.display = 'block';
		}
		else 
		{ // IE 4
			document.all.id.style.display = 'block';
		}
	}
}//end of showdiv

function showInsert() {
		if (document.getElementById('form').style.display == 'none') showdiv('form');
		else hidediv('form');
}//end of showInsert	

function checkUncheckAll() {
  if (document.getElementById('Check').value == 'Check All') {
    for (var i = 0; i < document.players.elements.length; i++){
       var check = document.players.elements[i];
       if (check.type == 'checkbox') {
 	check.checked = true;
       }
    }//end of for
    document.getElementById('Check').value = 'Uncheck All';
  }
  else {
        for (var i = 0; i < document.players.elements.length; i++){
       var check = document.players.elements[i];
       if (check.type == 'checkbox') {
 	check.checked = false;
       }
    }//end of for
    document.getElementById('Check').value = 'Check All';
  }
}//end of checkUncheckAll
